package controller.admin.order;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import model.VO.OrderVO;
import service.Impl.OrderServiceImpl;
import util.ResultUtil;

import java.io.IOException;

@WebServlet("/admin/order/details")
public class OrderInfoController extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        int id=Integer.parseInt(req.getParameter("id"));
        OrderServiceImpl orderService=new OrderServiceImpl();
        OrderVO orderVO=orderService.getInfo(id);
        String json= ResultUtil.getJSON(orderVO);
        resp.getWriter().write(json);

    }
}
